import url from './url'
import request from './request'

let header = {
  "Content-Type": "application/JSON"
}

export default {
  // 登录
  login(params) {
    return request.post(url.login, params, header)
  },
  getMailCode(params) {
    return request.post(url.getMailCode, params, header)
  },
  mailLogin(params) {
    return request.post(url.mailLogin, params, header)
  },
  getUserName() {
    return request.get(url.getUserName, {}, header)
  },
  getSuperUserName() {
    return request.get(url.getSuperUserName, {}, header)
  },
  deleteUser(params) {
    return request.post(url.deleteUser, params, header)
  },
  upUser(params) {
    return request.post(url.upUser, params, header)
  },
  lowUser(params) {
    return request.post(url.lowUser, params, header)
  },
  addUser(params) {
    return request.post(url.addUser, params, header)
  },
  getUser() {
    return request.get(url.getUser, {}, header)
  },

  // 顾客
  pageGetCustomerLists(params) {
    return request.post(url.pageGetCustomerLists, params, header)
  },
  pageGetCustomerNameLists(params) {
    return request.post(url.pageGetCustomerNameLists, params, header)
  },
  deleteCustomer(params) {
    return request.post(url.deleteCustomer, params, header)
  },
  addCustomer(params) {
    return request.post(url.addCustomer, params, header)
  },
  editCustomer(params) {
    return request.post(url.editCustomer, params, header)
  },
  batchDeleteCustomer(params) {
    return request.post(url.batchDeleteCustomer, params, header)
  },

  // 订单
  pageGetOrderLists(params) {
    return request.post(url.pageGetOrderLists, params, header)
  },
  pageGetPaidOrderLists(params) {
    return request.post(url.pageGetPaidOrderLists, params, header)
  },
  addOrder(params) {
    return request.post(url.addOrder, params, header)
  },
  toBePaid(params) {
    return request.post(url.toBePaid, params, header)
  },
  WaitingList(params) {
    return request.post(url.WaitingList, params, header)
  },
  delivery(params) {
    return request.post(url.delivery, params, header)
  },

  // 正式员工
  getOfficialStaffList() {
    return request.get(url.getOfficialStaffList, {}, header)
  },
  pagingOfficialStaffList(params) {
    return request.post(url.pagingOfficialStaffList, params, header)
  },
  searchOfficialStaffName(params) {
    return request.post(url.searchOfficialStaffName, params, header)
  },
  searchEntryStaffName(params) {
    return request.post(url.searchEntryStaffName, params, header)
  },
  pageSearchEntryStaffName(params) {
    return request.post(url.pageSearchEntryStaffName, params, header)
  },
  addOfficialStaff(params) {
    return request.post(url.addOfficialStaff, params, header)
  },
  delOfficialStaff(id) {
    return request.get(url.delOfficialStaff + `?id=${id}`, {}, header)
  },
  batchDelOfficialStaff(params) {
    return request.post(url.batchDelOfficialStaff, params, header)
  },
  updateOfficialStaff(params) {
    return request.post(url.updateOfficialStaff, params, header)
  },

  // 临时员工
  getTemporaryStaffList() {
    return request.get(url.getTemporaryStaffList, {}, header)
  },
  pageGetTemporaryStaffList(params) {
    return request.post(url.pageGetTemporaryStaffList, params, header)
  },
  searchTemporaryStaffName(params) {
    return request.post(url.searchTemporaryStaffName, params, header)
  },
  addTemporaryStaff(params) {
    return request.post(url.addTemporaryStaff, params, header)
  },
  updateTemporaryStaff(params) {
    return request.post(url.updateTemporaryStaff, params, header)
  },
  batchDeleteTemporaryStaff(params) {
    return request.post(url.batchDeleteTemporaryStaff, params, header)
  },
  becomeOfficialStaff(params) {
    return request.post(url.becomeOfficialStaff, params, header)
  },
  searchEntryStaffLists(params) {
    return request.post(url.searchEntryStaffLists, params, header)
  },
  pageSearchEntryStaffLists(params) {
    return request.post(url.pageSearchEntryStaffLists, params, header)
  },
  // 菜品
  getDishLists(params) {
    return request.get(url.getDishLists, params, header)
  },
  uploadDish(params) {
    return request.post(url.uploadDish, params, header)
  },
  editDish(params) {
    return request.post(url.editDish, params, header)
  },
  selectDishes(params) {
    return request.post(url.selectDishes, params, header)
  }
}
